home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_18_Set gCurrent Behavior.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  1.1 KB  |  37 lines

  1. property pDetailType
  2. global gCurrentText, gCurrentPhoto, gCurrentVideo
  3.  
  4. on beginSprite me
  5.   set previousItemDelimiter to the itemDelimiter
  6.   set the itemDelimiter to "."
  7.   set rootName to item 1 of the name of the member of sprite the spriteNum of me
  8.   set the itemDelimiter to previousItemDelimiter
  9.   case pDetailType of
  10.     #text:
  11.       set gCurrentText to rootName
  12.     #photo:
  13.       set gCurrentPhoto to rootName
  14.     #video:
  15.       set gCurrentVideo to rootName
  16.   end case
  17. end
  18.  
  19. on getPropertyDescriptionList me
  20.   set description to [:]
  21.   addProp(description, #pDetailType, [#default: #text, #format: #symbol, #comment: "Which gCurrent", #range: [#text, #photo, #video]])
  22.   return description
  23. end
  24.  
  25. on getBehaviorDescription me
  26.   set endChar to offset("--END OF HEADER", the text of me)
  27.   set endLine to the number of lines in char 1 to endChar of the text of me - 1
  28.   set description to line 1 to endLine of the text of me
  29.   repeat with whichLine = endLine down to 1
  30.     if line whichLine of description = EMPTY then
  31.       delete line whichLine of description
  32.     end if
  33.   end repeat
  34.   delete line 1 of description
  35.   return description
  36. end
  37.